<template>
  <div class="xlwjpg">
  <nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top">
  <img class="navbar-brand" src="../img/logo2.jpg" id="a1">
  <ul class="navbar-nav">
    <li class="nav-item">
      <a class="nav-link" href="#">欢迎{{$store.state.Login.name}}登录</a>
    </li>
  </ul>
</nav>

 <a @click="fanhui">返回</a>
    <br>
    请根据近一年的感觉，回答一下的问题
   <br>
  <div class="div1" v-if="isshow1">
    <span>敌对质</span><br>
     <ul>
      <span style="color:red">1/9</span> 
      <li v-for="(item,index) in anwser.dd" :key="item.qaid">
         {{index+1}} :
         <span>{{item.bank.qbname}}<br></span>
      <el-radio v-model="item.anwser" :label="0" >没有(根本不)</el-radio>&nbsp;
      <el-radio v-model="item.anwser" :label="1" >很少(有一点)</el-radio>
      <el-radio v-model="item.anwser" :label="2" >有时(有些)</el-radio>
      <el-radio v-model="item.anwser" :label="3" >经常(相当)</el-radio>
      <el-radio v-model="item.anwser" :label="4" >总是(一直)</el-radio>
       </li>
        <el-button @click="dierti()">下一题</el-button>
        </ul>
  </div>
 <div class="div2" v-if="isshow2" >
   <span>焦虑质</span><br>
    <span style="color:red">2/9</span> 
     <ul>
       
      <li v-for="(item,index) in anwser.jl" :key="item.qaid">
         {{index+1}} :2
         <span>{{item.bank.qbname}}<br></span>
      <el-radio v-model="item.anwser" :label="0" >没有(根本不)</el-radio>&nbsp;
      <el-radio v-model="item.anwser" :label="1" >很少(有一点)</el-radio>
      <el-radio v-model="item.anwser" :label="2" >有时(有些)</el-radio>
      <el-radio v-model="item.anwser" :label="3" >经常(相当)</el-radio>
      <el-radio v-model="item.anwser" :label="4" >总是(一直)</el-radio>
       </li>
       <el-button @click="disanti">下一题</el-button>
        </ul>
  </div>
   <div class="div3"  v-if="isshow3">
     <span>精神病性</span><br>
     <span style="color:red">3/9</span> 
     <ul>
      <li v-for="(item,index) in anwser.jsbx" :key="item.qaid">
         {{index+1}} :
         <span>{{item.bank.qbname}}<br></span>
      <el-radio v-model="item.anwser" :label="0" >没有(根本不)</el-radio>&nbsp;
      <el-radio v-model="item.anwser" :label="1" >很少(有一点)</el-radio>
      <el-radio v-model="item.anwser" :label="2" >有时(有些)</el-radio>
      <el-radio v-model="item.anwser" :label="3" >经常(相当)</el-radio>
      <el-radio v-model="item.anwser" :label="4" >总是(一直)</el-radio>
       </li>
        <el-button @click="disiti">下一题</el-button>
        </ul>
  </div>
   <div class="div4"  v-if="isshow4">
     <span>恐怖</span><br>
     <span style="color:red">4/9</span> 
     <ul>
      <li v-for="(item,index) in anwser.kb" :key="item.qaid">
         {{index+1}} :
         <span>{{item.bank.qbname}}<br></span>
      <el-radio v-model="item.anwser" :label="0" >没有(根本不)</el-radio>&nbsp;
      <el-radio v-model="item.anwser" :label="1" >很少(有一点)</el-radio>
      <el-radio v-model="item.anwser" :label="2" >有时(有些)</el-radio>
      <el-radio v-model="item.anwser" :label="3" >经常(相当)</el-radio>
      <el-radio v-model="item.anwser" :label="4" >总是(一直)</el-radio>
       </li>
        <el-button @click="diwuti">下一题</el-button>
        </ul>
  </div>
   <div class="div5" v-if="isshow5">
     <span>偏执</span><br>
     <span style="color:red">5/9</span> 
     <ul>
      <li v-for="(item,index) in anwser.pz" :key="item.qaid">
         {{index+1}} :
         <span>{{item.bank.qbname}}<br></span>
      <el-radio v-model="item.anwser" :label="0" >没有(根本不)</el-radio>&nbsp;
      <el-radio v-model="item.anwser" :label="1" >很少(有一点)</el-radio>
      <el-radio v-model="item.anwser" :label="2" >有时(有些)</el-radio>
      <el-radio v-model="item.anwser" :label="3" >经常(相当)</el-radio>
      <el-radio v-model="item.anwser" :label="4" >总是(一直)</el-radio>
       </li>
       <el-button @click="diliuti">下一题</el-button>
        </ul>
  </div>
   <div class="div6" v-if="isshow6">
     <span>强迫症化</span><br>
     <span style="color:red">6/9</span> 
     <ul>
      <li v-for="(item,index) in anwser.qpzh" :key="item.qaid">
         {{index+1}} :
         <span>{{item.bank.qbname}}<br></span>
      <el-radio v-model="item.anwser" :label="0" >没有(根本不)</el-radio>&nbsp;
      <el-radio v-model="item.anwser" :label="1" >很少(有一点)</el-radio>
      <el-radio v-model="item.anwser" :label="2" >有时(有些)</el-radio>
      <el-radio v-model="item.anwser" :label="3" >经常(相当)</el-radio>
      <el-radio v-model="item.anwser" :label="4" >总是(一直)</el-radio>
       </li>
        <el-button @click="diqiti">下一题</el-button>
        </ul>


  </div>
   <div class="div7" v-if="isshow7">
     <span>躯体化</span><br>
     <span style="color:red">7/9</span> 
     <ul>
      <li v-for="(item,index) in anwser.qth" :key="item.qaid">
         {{index+1}} :
         <span>{{item.bank.qbname}}<br></span>
      <el-radio v-model="item.anwser" :label="0" >没有(根本不)</el-radio>&nbsp;
      <el-radio v-model="item.anwser" :label="1" >很少(有一点)</el-radio>
      <el-radio v-model="item.anwser" :label="2" >有时(有些)</el-radio>
      <el-radio v-model="item.anwser" :label="3" >经常(相当)</el-radio>
      <el-radio v-model="item.anwser" :label="4" >总是(一直)</el-radio>
       </li>
        <el-button @click="dibati">下一题</el-button>
        </ul>
  </div>
   <div class="div8" v-if="isshow8">
     <span>人际关系</span><br>
     <span style="color:red">8/9</span> 
     <ul>
      <li v-for="(item,index) in anwser.rjgx" :key="item.qaid">
         {{index+1}} :
         <span>{{item.bank.qbname}}<br></span>
      <el-radio v-model="item.anwser" :label="0" >没有(根本不)</el-radio>&nbsp;
      <el-radio v-model="item.anwser" :label="1" >很少(有一点)</el-radio>
      <el-radio v-model="item.anwser" :label="2" >有时(有些)</el-radio>
      <el-radio v-model="item.anwser" :label="3" >经常(相当)</el-radio>
      <el-radio v-model="item.anwser" :label="4" >总是(一直)</el-radio>
       </li>
        <el-button @click="dijiuti">下一题</el-button>
        </ul>
  </div>
   <div class="div9" v-if="isshow9">
     <span>犹豫</span><br>
     <span style="color:red">9/9</span> 
     <ul>
      <li v-for="(item,index) in anwser.yy" :key="item.qaid">
         {{index+1}} :
         <span>{{item.bank.qbname}}<br></span>
      <el-radio v-model="item.anwser" :label="0" >没有(根本不)</el-radio>&nbsp;
      <el-radio v-model="item.anwser" :label="1" >很少(有一点)</el-radio>
      <el-radio v-model="item.anwser" :label="2" >有时(有些)</el-radio>
      <el-radio v-model="item.anwser" :label="3" >经常(相当)</el-radio>
      <el-radio v-model="item.anwser" :label="4" >总是(一直)</el-radio>
       </li>
        <el-button @click="tijiao">完成</el-button>
        </ul>
  </div>
 

  





  </div>
</template>
<script>
 import axios from 'axios' 
axios.defaults.baseURL="http://localhost:8085";
export default ({
 data(){
   return {
    anwser:{},
    isshow1:true,
    isshow2:false,
    isshow3:false,
    isshow4:false,
    isshow5:false,
    isshow6:false,
    isshow7:false,
    isshow8:false,
    isshow9:false,
     huiyuaid:this.$store.state.Login.id
   }
 },
 methods:{
    dierti(){
     this.isshow1=false;
     this.isshow2=true;
     
   },
   disanti(){
     this.isshow1=false;
     this.isshow2=false;
     this.isshow3=true;
   },
   disiti(){
     this.isshow1=false;
     this.isshow2=false;
     this.isshow3=false;
     this.isshow4=true;
   },
   diwuti(){
     this.isshow1=false;
     this.isshow2=false;
     this.isshow3=false;
     this.isshow4=false;
     this.isshow5=true;
   },
   diliuti(){
     this.isshow1=false;
     this.isshow2=false;
     this.isshow3=false;
     this.isshow4=false;
     this.isshow5=false;
     this.isshow6=true;
   },
   diqiti(){
     this.isshow1=false;
     this.isshow2=false;
     this.isshow3=false;
     this.isshow4=false;
     this.isshow5=false;
     this.isshow6=false;
     this.isshow7=true;
   },
   dibati(){
     this.isshow1=false;
     this.isshow2=false;
     this.isshow3=false;
     this.isshow4=false;
     this.isshow5=false;
     this.isshow6=false;
     this.isshow7=false;
     this.isshow8=true;
   },
   dijiuti(){
     this.isshow1=false;
     this.isshow2=false;
     this.isshow3=false;
     this.isshow4=false;
     this.isshow5=false;
     this.isshow6=false;
     this.isshow7=false;
     this.isshow8=false;
     this.isshow9=true;
   },
   
   tijiao(){
     this.anwser.huiyuaid=this.huiyuaid
      axios.post("/addanwser2",this.anwser).then(()=>{
alert("你已完成所有问题")
      this.$router.push({
		path: '/home',
	});
      })
      
   },
   fanhui(){
     this.$router.push({
		path: '/home',
	});
}
 },
 created(){
    axios.post("/selanwser2",{tMemberId:1,questid:1}).then((response)=>{
      this.anwser= response.data
			})
 }
})
</script>
